package cn.gson.springboot.model.pjos;

import cn.afterturn.easypoi.excel.annotation.Excel;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Culinkman {
    private int cupId;
    private String cupName;
    private String cupSex;
    private String cupPhone;
    private String cupAddressProvince;
    private String cupAddressCity;
    private String cupAddressArea;
    private String cupXxaddress;
    private String cupPost;
    private String cupQq;
    private String cupEmail;
    private String cupRemark;
    private Integer cupState;
    private Integer cupMaster;
    private Timestamp cupCreateTime;
    private Collection<BusinessInfo> businessInfosByCupId;
    private Customer customerByCustomId;

    @Id
    @Column(name = "cup_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getCupId() {
        return cupId;
    }

    public void setCupId(int cupId) {
        this.cupId = cupId;
    }

    @Basic
    @Column(name = "cup_name")
    public String getCupName() {
        return cupName;
    }

    public void setCupName(String cupName) {
        this.cupName = cupName;
    }

    @Basic
    @Column(name = "cup_sex")
    public String getCupSex() {
        return cupSex;
    }

    public void setCupSex(String cupSex) {
        this.cupSex = cupSex;
    }

    @Basic
    @Column(name = "cup_phone")
    public String getCupPhone() {
        return cupPhone;
    }

    public void setCupPhone(String cupPhone) {
        this.cupPhone = cupPhone;
    }

    @Basic
    @Column(name = "cup_address_province")
    public String getCupAddressProvince() {
        return cupAddressProvince;
    }

    public void setCupAddressProvince(String cupAddressProvince) {
        this.cupAddressProvince = cupAddressProvince;
    }

    @Basic
    @Column(name = "cup_address_city")
    public String getCupAddressCity() {
        return cupAddressCity;
    }

    public void setCupAddressCity(String cupAddressCity) {
        this.cupAddressCity = cupAddressCity;
    }

    @Basic
    @Column(name = "cup_address_area")
    public String getCupAddressArea() {
        return cupAddressArea;
    }

    public void setCupAddressArea(String cupAddressArea) {
        this.cupAddressArea = cupAddressArea;
    }

    @Basic
    @Column(name = "cup_xxaddress")
    public String getCupXxaddress() {
        return cupXxaddress;
    }

    public void setCupXxaddress(String cupXxaddress) {
        this.cupXxaddress = cupXxaddress;
    }

    @Basic
    @Column(name = "cup_post")
    public String getCupPost() {
        return cupPost;
    }

    public void setCupPost(String cupPost) {
        this.cupPost = cupPost;
    }

    @Basic
    @Column(name = "cup_qq")
    public String getCupQq() {
        return cupQq;
    }

    public void setCupQq(String cupQq) {
        this.cupQq = cupQq;
    }

    @Basic
    @Column(name = "cup_email")
    public String getCupEmail() {
        return cupEmail;
    }

    public void setCupEmail(String cupEmail) {
        this.cupEmail = cupEmail;
    }

    @Basic
    @Column(name = "cup_remark")
    public String getCupRemark() {
        return cupRemark;
    }

    public void setCupRemark(String cupRemark) {
        this.cupRemark = cupRemark;
    }

    @Basic
    @Column(name = "cup_state")
    public Integer getCupState() {
        return cupState;
    }

    public void setCupState(Integer cupState) {
        this.cupState = cupState;
    }

    @Basic
    @Column(name = "cup_master")
    public Integer getCupMaster() {
        return cupMaster;
    }

    public void setCupMaster(Integer cupMaster) {
        this.cupMaster = cupMaster;
    }

    @Basic
    @Column(name = "cup_create_time")
    public Timestamp getCupCreateTime() {
        return cupCreateTime;
    }

    public void setCupCreateTime(Timestamp cupCreateTime) {
        this.cupCreateTime = cupCreateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Culinkman culinkman = (Culinkman) o;
        return cupId == culinkman.cupId &&
                Objects.equals(cupName, culinkman.cupName) &&
                Objects.equals(cupSex, culinkman.cupSex) &&
                Objects.equals(cupPhone, culinkman.cupPhone) &&
                Objects.equals(cupAddressProvince, culinkman.cupAddressProvince) &&
                Objects.equals(cupAddressCity, culinkman.cupAddressCity) &&
                Objects.equals(cupAddressArea, culinkman.cupAddressArea) &&
                Objects.equals(cupXxaddress, culinkman.cupXxaddress) &&
                Objects.equals(cupQq, culinkman.cupQq) &&
                Objects.equals(cupEmail, culinkman.cupEmail) &&
                Objects.equals(cupRemark, culinkman.cupRemark) &&
                Objects.equals(cupState, culinkman.cupState) &&
                Objects.equals(cupMaster, culinkman.cupMaster);
    }

    @Override
    public int hashCode() {
        return Objects.hash(cupId, cupName, cupSex, cupPhone, cupAddressProvince, cupAddressCity, cupAddressArea, cupXxaddress, cupQq, cupEmail, cupRemark, cupState, cupMaster);
    }

    @OneToMany(mappedBy = "culinkmanByCupId")
    public Collection<BusinessInfo> getBusinessInfosByCupId() {
        return businessInfosByCupId;
    }

    public void setBusinessInfosByCupId(Collection<BusinessInfo> businessInfosByCupId) {
        this.businessInfosByCupId = businessInfosByCupId;
    }

    @ManyToOne
    @JoinColumn(name = "custom_id", referencedColumnName = "custom_id")
    public Customer getCustomerByCustomId() {
        return customerByCustomId;
    }

    public void setCustomerByCustomId(Customer customerByCustomId) {
        this.customerByCustomId = customerByCustomId;
    }

    /*@Override
    public String toString() {
        return "Culinkman{" +
                "cupId=" + cupId +
                ", cupName='" + cupName + '\'' +
                ", cupSex='" + cupSex + '\'' +
                ", cupPhone='" + cupPhone + '\'' +
                ", cupAddressProvince='" + cupAddressProvince + '\'' +
                ", cupAddressCity='" + cupAddressCity + '\'' +
                ", cupAddressArea='" + cupAddressArea + '\'' +
                ", cupXxaddress='" + cupXxaddress + '\'' +
                ", cupQq='" + cupQq + '\'' +
                ", cupEmail='" + cupEmail + '\'' +
                ", cupRemark='" + cupRemark + '\'' +
                ", cupState=" + cupState +
                ", cupMaster=" + cupMaster +
                ", customerByCustomId=" + customerByCustomId +
                '}';
    }*/
}
